﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DSA___semestralkaA___2
{
    public class Mesto : IKlic, IComparable
    {


        private int x;
        private int y;
        private string nazevMesta;
        private bool pzs;
        private int lzsRozsah;
        private int cena;

        public int Cena
        {
            get { return cena; }
            set { cena = value; }
        }
        


        //konstruktor pro hledání
        public Mesto(int souradniceX, int souradniceY)
        {
            this.X = souradniceX;
            this.Y = souradniceY;
        }

        //konstruktor pro hledání
        public Mesto(int souradniceX, int souradniceY, string nazev)
        {
            this.X = souradniceX;
            this.Y = souradniceY;
            this.NazevMesta = nazev;
        }

        //konstruktor pro vytvoření celého města
        public Mesto(int souradniceX, int souradniceY, string nazev, bool pozemni, int leteckaRadius)
        {
            this.X = souradniceX;
            this.Y = souradniceY;
            this.NazevMesta = nazev;
            this.PZS = pozemni;
            this.LZS = leteckaRadius;
        }

        public string NazevMesta
        {
            get { return nazevMesta; }
            set { nazevMesta = value; }
        }
        

        public int Y
        {
            get { return y; }
            set { y = value; }
        }
        

        public int X
        {
            get { return x; }
            set { x = value; }
        }

        public int LZS
        {
            get { return lzsRozsah; }
            set { lzsRozsah = value; }
        }


        public bool PZS
        {
            get { return pzs; }
            set { pzs = value; }
        }


        public int getX()
        {
            return x;
        }

        public int getY()
        {
            return y;
        }

        public string getName()
        {
            return NazevMesta;
        }

        public override string ToString()
        {
            return getX().ToString() + "|" + getY().ToString() + "|" + PZS.ToString() + "|" + LZS.ToString() + "|" + getName()+"";
        }

        public int CompareTo(object obj)
        {
            int cc = ((Mesto)obj).Cena;

            if (cc > Cena) return -1;
            else return 1;
        }
    }
}
